<?php

//站点通告表
class notice extends spModel
{
	public $pk = "id"; // 数据表的主键
    public $table = "notices"; // 数据表的名称

	function create($row) {
		parent::create($row);
		$lastInsertId = $this->_db->newinsertid();
		$mUserLog = spClass('userlog');
		$logArray = array(
							'uid' => $_SESSION['uid'],
							'type'=> 'addblognotice',
							'content' => 'Add notice ' . $lastInsertId,
							'dateline'=> time()
						);
	    $mUserLog->create($logArray);
	}

	function update($row) {
		$mUserLog = spClass('userlog');
		$logArray = array(
							'uid' => $_SESSION['uid'],
							'type'=> 'editnotice',
							'content' => 'Edit notice ' . $row['id'],
							'dateline'=> time()
						);
	    $mUserLog->create($logArray);
		parent::update($row);
	}

}